package controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
import pojo.Muser;
import service.MyService;

import javax.annotation.Resource;
import javax.annotation.Resources;

/**
 * @author wyj
 * @date 2019/3/14
 * @time 下午1:54
 */
@Controller
@RequestMapping("sl")
public class Mycontrol {
    @Resource(name="myservice")
    MyService myservice;
    @RequestMapping("login")
    public ModelAndView login(Muser muser){
        ModelAndView modelAndView ;
        System.out.println("欢迎登陆"+muser.getUsername()+muser.getPass());
        Boolean boolen= myservice.login(muser);
        if (boolen){
            modelAndView=new ModelAndView("index");
        }else{
            modelAndView=new ModelAndView("index");
        }
        modelAndView.addObject("","");
        return  modelAndView;

    }


}
